//输入123计算1+2+3
public class Test {
    public static  int fun(int n) {
        if(n < 10) {
            return n;
        }
        return (n%10)+fun(n/10);
    }
    public static void main(String[] args) {
        int ret = fun(123);
        System.out.println(ret);
    }
}
